package com.example.xianzhi.controller.API;

import cn.hutool.json.JSONUtil;
import com.example.xianzhi.entity.TbGoods;
import com.example.xianzhi.entity.TbHistory;
import com.example.xianzhi.service.HistoryService;
import com.example.xianzhi.service.impl.HistoryServiceImpl;
import org.lanqiao.mvc.entity.YockMvcAnnotation;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@YockMvcAnnotation.Controller("/apl_History")
public class Apl_HistoryController {
    private HistoryService historyService = new HistoryServiceImpl();




    @YockMvcAnnotation.RequestMapping("/histdeleapi.do")	//配置二级路径
    @YockMvcAnnotation.ResponseVoid
    public void histdeleapi(
            HttpServletRequest request,
            HttpServletResponse response,
            @YockMvcAnnotation.RequestParam(name = "history_id") int history_id
    ) throws Exception{
        //允许的请求的域是*，代表所有
        response.setHeader("Access-Control-Allow-Origin","*");

        //删除收藏信息
        historyService.deletehist(history_id);


    }
}
